Borland Online And The Cobb Group Present:


September, 1994 - Vol. 1 No. 9

Borland C++ 4.0 IDE - Setting options for one-file applications

For most applications you write with Borland C++ 4.0, you'll create a project file. When you create a new project, you specify the attributes of the output file, or target, along with the name of the project. For example, you specify whether the target file will be an application, a dynamic link library (DLL), a static library (LIB), or a help file.

Later, if you decide to change some of the settings, you can right-click on the target in the Project window and choose TargetExpert... from the pop-up menu to display the TargetExpert dialog box. However, if you're writing a one-file application and the file isn't part of a project, you won't be able to open the TargetExpert dialog box this way­­there isn't a Project window unless there's a project.

Fortunately, you can still access these settings for one-file applications. In this article, we'll show you how to display the TargetExpert dialog box for applications you create from a single source file.

Single-file targets

If you're editing a file that's part of a project and you right-click in the source file's window, you'll see the standard pop-up menu, or speedmenu, for source files, as shown in Figure A. This speedmenu allows you to perform various tasks that relate to the contents of the current file or the position of the cursor in that particular source file (for debugging purposes).


Figure A - The standard speedmenu allows you to execute commands on a particular source file.

However, if you right-click in the window of a source file that isn't part of a project, and there isn't a current project file open, you'll see some new commands appear on the source file speedmenu, as shown in Figure B. These commands allow you to set the attributes of the default project file that Borland C++ uses for applications that aren't part of a specific project file.


Figure B - The speedmenu for one-file applications allows you to perform some of the commands that normally apply to a project.

By selecting Target Expert from the source file's speedmenu, you'll see the same TargetExpert dialog box you see for project-based applications. In addition, if you modify any target attributes from this dialog box, you'll change the attributes for the default project file and therefore affect the settings of all one-file projects you create in the future.

Return to the Borland C++ Developer's Journal index

Subscribe to the Borland C++ Developer's Journal


Copyright (c) 1996 The Cobb Group, a division of Ziff-Davis Publishing Company. All rights reserved. Reproduction in whole or in part in any form or medium without express written permission of Ziff-Davis Publishing Company is prohibited. The Cobb Group and The Cobb Group logo are trademarks of Ziff-Davis Publishing Company.